<ui:composition         
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:ds="http://deltaset.org/deltaset-faces"
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui">

   <h:form id="form">  
   
    <p:panel header="Create a new book">  
        <h:panelGrid columns="2" id="grid">  
            <h:outputLabel value="Title : *" for="txt_title"></h:outputLabel>  
            <p:inputText id="txt_title"   
                            value="#{createBookBean.book.title}" required="true"/>  
              
            <h:outputLabel value="Author : *" for="txt_author"></h:outputLabel>  
            <p:inputText id="txt_author" required="true"   
                            value="#{createBookBean.book.author}" />  
              
            <p:commandButton value="Reset" type="reset"/>  
            <p:commandButton value="Add" update="books @parent"  
                            action="#{createBookBean.reinit}" >  
                <p:collector value="#{createBookBean.book}"   
                            addTo="#{createBookBean.books}" />  
            </p:commandButton>  
        </h:panelGrid>  
    </p:panel>  
      
    <p:outputPanel id="books">  
        <p:dataTable value="#{createBookBean.books}" var="book">  
  
            <p:column>  
                <f:facet name="header">  
                    <h:outputText value="Title" />  
                </f:facet>  
                <h:outputText value="#{book.title}" />  
            </p:column>  
  
            <p:column>  
                <f:facet name="header">  
                    <h:outputText value="Author" />  
                </f:facet>  
                <h:outputText value="#{book.author}" />  
            </p:column>  
  
            <p:column>  
                <f:facet name="header">  
                    <h:outputText value="Operation" />  
                </f:facet>  
                <p:commandLink value="Remove" update="#{cc.clientId}:form:books" process="@this">  
                    <p:collector value="#{book}"  
                                 removeFrom="#{createBookBean.books}" />  
                </p:commandLink>  
            </p:column>  
  
        </p:dataTable>  
    </p:outputPanel>  
  
</h:form>

</ui:composition>   
